var scoreList={};
$(document).ready(function(){ 
	var paraData = {teamId:teamId,tmGameId:tmGameId,startDate:startDate,endDate:endDate,tmScoreListId:tmScoreListId};
	$.getJSON(path+"/soccer/tmMemberAction!selectScoreList.action",paraData, function(data){
		scoreList = data.scoreList;
	  	var scoreHtml=[];
	  	var lastItemValue="-1";
	  	var indexNo=0;
	  	$.each(scoreList,function(index,obj){
	  		if(obj.itemValue!=lastItemValue){
	  			indexNo++;
	  		}
	  		scoreHtml.push("<tr onclick='viewDetail("+obj.logUserId+",1)'>");
	  		scoreHtml.push("<td nowrap='nowrap' style='color:yellow'>"+indexNo+"</td>");
	  		scoreHtml.push("<td nowrap='nowrap' style='color:yellow'>"+obj.playerNo+"</td>");
	  		scoreHtml.push("<td nowrap='nowrap' style='color:yellow'>"+obj.logUserName+"</td>");
	  		scoreHtml.push("<td nowrap='nowrap' style='color:yellow'>"+obj.itemValue+"</td>");
	  		scoreHtml.push("</tr>");
	  		lastItemValue=obj.itemValue;
	  	});
	  	$("#scoreBody").html(scoreHtml.join("")); 
	});
	
});
function viewDetail(logUserId,itemId){
	var timestamp = (new Date()).valueOf();
	backURL="/soccer/teamGameDataSet-score.jsp";
	window.location.href=path+"/soccer/teamGameDataPersonView.jsp?teamId="+teamId+"&tmGameId="+tmGameId+"&tmScoreListId="+tmScoreListId
	+"&startDate="+startDate+"&endDate="+endDate+"&itemId="+itemId+"&playUserId="+logUserId+"&backURL="+backURL+"&currentTab=scoreLi"+"&timestamp="+timestamp;
}
